package com.jch.helloworld.configBeans.factoryBean;

import java.util.HashMap;
import java.util.Map;

/**
 * 实例工厂方法示例
 */
public class InstanceFactory {

    private Map<String,BeanDemo> instanceFactory = null;

    public InstanceFactory() {
        instanceFactory = new HashMap<>();
        instanceFactory.put("iBean0",new BeanDemo("iBean0","this is iBean0", "i0"));
        instanceFactory.put("iBean1",new BeanDemo("iBean1","this is iBean1","i1"));
    }

    public BeanDemo getBeanDemo(String name){
      return instanceFactory.get(name);
    }
}
